﻿using DomainCommons.Models;
using Microsoft.AspNetCore.Identity;

namespace IdentityServer.Domain.Entities
{
    public class AppUser : IdentityUser<Guid>, IHasCreationTime, IHasDeletionTime, ISoftDelete
    {
        public DateTime CreationTime { get; init; }
        public DateTime? DeletionTime { get; private set; }
        public bool IsDeleted { get; set; }

        public AppUser(string userName):base(userName)
        {
            CreationTime = DateTime.Now;
        }
        public void SoftDelete()
        {
            this.IsDeleted = true;
            DeletionTime= DateTime.Now;
        }
        public AppUser() { CreationTime = DateTime.Now; }
    }
}
